from utils.client import APIClient
from utils.yaml_config import get_yaml

data = get_yaml('site.yaml')

class SiteAPI:


    def __init__(self,client:APIClient):
        self.client = client

    def site_top(self):
        site_data = data['top']['request']
        return self.client.request(site_data['method'],site_data['path'])
    
    def site_head(self):
        site_data = data['head']['request']
        return self.client.request(site_data['method'],site_data['path'],json=site_data['json'])
    
    def site_front(self):
        site_data = data['front']['request']
        return self.client.request(site_data['method'],site_data['path'])
    
    def site_info(self):
        site_data = data['info']['request']
        return self.client.request(site_data['method'],site_data['path'])

    def site_get(self):
        site_data = data['get']['request']
        return self.client.request(site_data['method'],site_data['path'])
    
    def site_list(self):
        site_data = data['list']['request']
        return self.client.request(site_data['method'],site_data['path'],json=site_data['json'])
    
    def site_statistics(self):
        site_data = data['statistics']['request']
        return self.client.request(site_data['method'],site_data['path'],json=site_data['json'])
    
    def site_realtime(self):
        site_data = data['realtime']['request']
        return self.client.request(site_data['method'],site_data['path'],json=site_data['json'])